<%--                                                                       --%>
<%-- Copyright (c) 2005 BroadVision, Inc.  All rights reserved.            --%>
<%--                                                                       --%>
<%-- This software is copyrighted. Under the copyright laws, this software --%>
<%-- may not be copied, in whole or in part, without prior written consent --%>
<%-- of BroadVision, Inc. or its assignees. This software is provided      --%>
<%-- under the terms of a license between BroadVision and the recipient,   --%>
<%-- and its use is subject to the terms of that license.                  --%>
<%--                                                                       --%>
<%-- This software may be protected by one or more U.S. and International  --%>
<%-- patents.  Certain applications of BroadVision One-To-One software are --%>
<%-- covered by U.S. patent 5,710,887.                                     --%>
<%--                                                                       --%>
<%-- TRADEMARKS: BroadVision and BroadVision One-To-One are registered     --%>
<%-- trademarks of BroadVision, Inc., in the United States and the         --%>
<%-- European Community, and are trademarks of BroadVision, Inc., in other --%>
<%-- countries.  The BroadVision logo, is a trademark of BroadVision,      --%>
<%-- Inc., in the United States and other countries. Additionally, IONA    --%>
<%-- and Orbix are trademarks of IONA Technologies, Ltd.  RSA, MD5, and    --%>
<%-- RC2 are trademarks of RSA Data Security, Inc.                         --%>
<%--                                                                       --%>

<%@ taglib uri="/WEB-INF/c.tld" prefix="c" %>
<%@ taglib uri="/WEB-INF/struts-html-el.tld" prefix="html-el" %>
<%@ taglib uri="/WEB-INF/struts-bean-el.tld" prefix="bean-el" %>

<script language="JavaScript">

//
//
//
function doDone(form) {
  form.action = "<c:url value="/ep/cancel.do"/>";
  form.submit();
} 

function doBVCAction(cntOID,catOID,cntTypeId,cntAction){
  var theURL="/cm/cmBVCProcessMapping.do";
  var theParam="?contentOID="+cntOID+"&categoryOID="+catOID+"&contentTypeId="+cntTypeId+"&contentAction="+cntAction+"&exitURL=/cm/closeWindowAlwaysRefresh.do";
  var url = '<html-el:rewrite page="'+theURL+'" />'+theParam;
  var qualifier = window.open(url, "_blank",
                              "directories=no,height=500,width=650,left=50,top=50,resizable=yes,scrollbars=yes,location=yes,menubar=yes,status=yes,toolbar=yes");

  if (qualifier != null){
    if (qualifier.opener == null)
        qualifier.opener = self;
        qualifier.focus();
  }
 }
</script>

<table class="zoneFive" width="100%" border="0" cellspacing="0" cellpadding="0" summary="content area">
  <tr>
    <td valign="top" width="100%">
      <div class="pageTitle">
      <bean-el:message key="ep.program.view.page.title" bundle="ep.messages" arg0="${epProgramPresentationView.map.name}"/>
      </div>
      <div class="errorMessage"><html-el:errors bundle="ep.messages"/></div>
      <%@ include file="/mc/common/pagetab.jsp" %>

      <!- place body here -->
      <div class="breadcrumb">
      <c:if test="${not empty epProgramPresentationView.map.breadcrumbs}">
        <c:forEach var="channel" items="${epProgramPresentationView.map.breadcrumbs}" varStatus="index">
          <c:url var="browseUrl" value="/ep/channelBrowse.do">
            <c:param name="channelId" value="${channel.map.id}"/>
          </c:url>
          <c:if test="${index.count > 1}"><bean-el:message key="ep.breadcrumb.delimiter" bundle="ep.messages"/>&nbsp;</c:if><a href="<c:out value="${browseUrl}"/>"><c:out value="${channel.map.name}"/></a>
        </c:forEach>
      </c:if>
      </div>

      <html-el:form action="/ep/programPresentationEdit.do">

      <input type="hidden" name="programId" value="<c:out value="${epProgramPresentationView.map.id}"/>"/>
      <input type="hidden" name="ctx.f" value="<c:out value="${requestScope['ctx.f']}"/>"/>

      <div class="pageSubtitle">
        <span class="left"><bean-el:message key="ep.program.information" bundle="ep.messages"/></span>
        <span class="right">
<c:if test="${epProgramPresentationView.map.editable}">
          <input type="submit" class="inputButton" value="<bean-el:message key="button.edit" bundle="ep.messages"/>">
</c:if>
        </span>
      </div>

      </html-el:form>

      <table class="labelForm" width="100%" border="0" cellspacing="0" cellpadding="0">

      <tr>
        <td class="label" width="30%"><bean-el:message key="ep.program.data.source" bundle="ep.messages"/>:</td>
        <td class="labelField" width="70%"><c:out value="${epProgramPresentationView.map.srcTypeDTO.label}"/>
        </td>
      </tr>

<c:if test="${epProgramPresentationView.map.srcTypeDTO.value == 0}">
      <tr>
        <td class="label" width="30%">&nbsp;</td>
        <td class="labelField" width="70%">
          <table border="0" cellspacing="0" cellpadding="0">
          <tr>
            <td class="labelField">
            <bean-el:message key="ep.program.content.type" bundle="ep.messages"/>:</td>
            <td class="labelField"><c:out value="${epProgramPresentationView.map.srcContentTypeDTO.label}"/></td>
          </tr>
          <tr> 
            <td class="labelField"> 
            <bean-el:message key="ep.program.source.type.ruleset" bundle="ep.messages"/>:</td>
            <td class="labelField"><c:out value="${epProgramPresentationView.map.srcDTO.label}"/></td>
          </tr>
          <tr> 
            <td class="labelField"> 
            <bean-el:message key="ep.program.publishing.category" bundle="ep.messages"/>:</td>
            <td class="labelField"><c:out value="${epProgramPresentationView.map.publishCategoryDTO.label}"/></td>
          </tr>
          <tr> 
            <td class="labelField">
              <bean-el:message key="ep.program.publishing.process" bundle="ep.messages"/>:
            </td>
            <td class="labelField"><c:out value="${epProgramPresentationView.map.publishingProcessDTO.label}"/></td>            
          </tr>
          <tr> 
            <td class="labelField" colspan="2">
              <input type="checkbox"<c:if test="${epProgramPresentationView.map.showOnlyReadable}"> checked="checked"</c:if> disabled="disabled"/>&nbsp;<bean-el:message key="ep.program.only.show.readable.content" bundle="ep.messages"/>
            </td>
          </tr>
          </table>
        </td>
      </tr>
</c:if>

<c:if test="${epProgramPresentationView.map.srcTypeDTO.value == 1 || epProgramPresentationView.map.srcTypeDTO.value == 6}">
      <tr>
        <td class="label" width="30%">&nbsp;</td>
        <td class="labelField" width="70%">
          <table border="0" cellspacing="0" cellpadding="0">
          <tr>
            <td class="labelField">
            <bean-el:message key="ep.program.content.type" bundle="ep.messages"/>:</td>
            <td class="labelField"><c:out value="${epProgramPresentationView.map.srcContentTypeDTO.label}"/></td>
          </tr>
          <tr>
            <td class="labelField"> 
            <bean-el:message key="ep.category" bundle="ep.messages"/>:</td>
            <td class="labelField"><c:out value="${epProgramPresentationView.map.srcDTO.label}"/></td>
          </tr>
        <c:if test="${epProgramPresentationView.map.srcContentTypeDTO.value != '50'}">
          <tr>
            <td class="labelField">
            <bean-el:message key="ep.program.publishing.process" bundle="ep.messages"/>:
            </td>
            <td class="labelField"><c:out value="${epProgramPresentationView.map.publishingProcessDTO.label}"/></td>            
          </tr>
        </c:if>
          <tr>
            <td class="labelField" colspan="2">
              <c:if test="${epProgramPresentationView.map.srcTypeDTO.value == 1}">
              	<input type="checkbox"<c:if test="${epProgramPresentationView.map.subCatIncluded}"> checked="checked"</c:if> disabled="disabled"/>&nbsp;<bean-el:message key="ep.program.include.subcategories" bundle="ep.messages"/><br>
              </c:if>
              <input type="checkbox"<c:if test="${epProgramPresentationView.map.showOnlyReadable}"> checked="checked"</c:if> disabled="disabled"/>&nbsp;<bean-el:message key="ep.program.only.show.readable.content" bundle="ep.messages"/>
            </td>
          </tr>
          </table>
      </tr>
</c:if>

<c:if test="${epProgramPresentationView.map.srcTypeDTO.value == 2}">
      <tr>
        <td class="label" width="30%">&nbsp;</td>
        <td class="labelField" width="70%">
          <table border="0" cellspacing="0" cellpadding="0">
          <tr>
            <td class="labelField">
            <bean-el:message key="ep.program.content.type" bundle="ep.messages"/>:</td>
            <td class="labelField"><c:out value="${epProgramPresentationView.map.srcContentTypeDTO.label}"/></td>
          </tr>
          <tr> 
            <td class="labelField"> 
              <bean-el:message key="ep.program.source.type.content" bundle="ep.messages"/>:</td>
            <td class="labelField"><a href="javascript:doBVCAction( <c:out value="${epProgramPresentationView.map.contentOid}"/>,'','2','ViewContent')" ><c:out value="${epProgramPresentationView.map.srcDTO.label}"/></a></td>
          </tr>
          </table>
        </td>
      </tr>
</c:if>

<c:if test="${epProgramPresentationView.map.srcTypeDTO.value == 3}">
      <tr>
        <td class="label" width="30%">&nbsp;</td>
        <td class="labelField" width="70%">
          <table border="0" cellspacing="0" cellpadding="0">
          <tr> 
            <td class="labelField"> 
              <bean-el:message key="ep.program.page.script.path" bundle="ep.messages"/>:</td>
            <td class="labelField"><c:out value="${epProgramPresentationView.map.pagePath}"/></td>
          </tr>
          <tr> 
            <td class="labelField"> 
              <bean-el:message key="ep.program.block.script.path" bundle="ep.messages"/>:</td>
            <td class="labelField"><c:out value="${epProgramPresentationView.map.embedScriptPath}"/></td>
          </tr>
          </table>
        </td>
      </tr>
</c:if>

<c:if test="${epProgramPresentationView.map.srcTypeDTO.value == 4}">
      <tr>
        <td class="label" width="30%">&nbsp;</td>
        <td class="labelField" width="70%">
          <table border="0" cellspacing="0" cellpadding="0">
          <tr> 
            <td class="labelField"> 
              <bean-el:message key="ep.program.source.type.url" bundle="ep.messages"/>:</td>
            <td class="labelField"><c:out value="${epProgramPresentationView.map.pagePath}"/></td>
          </tr>
          </table>
        </td>
      </tr>
</c:if>

<c:if test="${epProgramPresentationView.map.srcTypeDTO.value != 3 && epProgramPresentationView.map.srcTypeDTO.value != 4}">
      <tr>
        <td class="label" width="30%"><bean-el:message key="ep.program.program.display.template" bundle="ep.messages"/>:</td>
        <td class="labelField" width="70%"><c:out value="${epProgramPresentationView.map.programDisplayTemplateDTO.label}"/>
        </td>
      </tr>

      <tr>
        <td class="label" width="30%"><bean-el:message key="ep.program.content.display.template" bundle="ep.messages"/>:</td>
        <td class="labelField" width="70%"><c:out value="${epProgramPresentationView.map.contentDisplayTemplateDTO.label}"/>
        </td>
      </tr>
</c:if>

      <tr>
        <td class="label" width="30%"><bean-el:message key="ep.program.cache.configuration" bundle="ep.messages"/>:</td>
        <td class="labelField" width="70%">

          <table cellpadding="0" cellspacing="0" border="0">
            <tr>
               <td class="labelField" colspan="2">
                 <input type="checkbox"<c:if test="${epProgramPresentationView.map.cacheable}"> checked="checked"</c:if> disabled="disabled"/>&nbsp;<bean-el:message key="ep.program.cache.use" bundle="ep.messages"/>
               </td>
            </tr>
            <tr>
               <td class="labelField">
                 <bean-el:message key="ep.program.cache.timeout" bundle="ep.messages"/>:
               </td>
               <td class="labelField">
                 <bean-el:message key="ep.program.cache.seconds.arg" arg0="${epProgramPresentationView.map.timeout}" bundle="ep.messages"/>
               </td>
            </tr>
          </table>

        </td>
      </tr>

      </table>

<c:if test="${0 == 1}">
      <form method="post">

      <input type="hidden" name="channelId" value="<c:out value="${epChannelAdministratorsView.map.id}"/>"/>
      <input type="hidden" name="ctx.f" value="<c:out value="${requestScope['ctx.f']}"/>"/>

      <div class="pageButtonWrap" align="right">
        <input type="button" name="done" class="inputButton" value="<bean-el:message key='button.done' bundle="ep.messages"/>" onclick="doDone(this.form)">
      </div>

      </form>
</c:if>

    </td>
  </tr>
</table>
